package blatt1;

public class MovableBall extends Ball {

	protected double dx;
	protected double dy;

	public MovableBall(int x, int y, int r) {
		super(x, y, r);
		dx = 0;
		dy = 0;
	}

	public void setMotion(double ndx, double ndy) {
		dx = ndx;
		dy = ndy;
	}

	public double xMotion() {
		return dx;
	}

	public double yMotion() {
		return dy;
	}

	public void move() {
		location.translate((int) dx, (int) dy);
	}

	public void moveTo(int x, int y) {
		location.setLocation(x, y);
	}
}
